﻿using System;
using System.Diagnostics;
using EasyComm.SDK;
using EasyComm.SDK.Configuration;
using EasyComm.WorkerService;

namespace EasyComm.SDKTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //Trace.Write("Checking NLB Router online status...");
            //Console.WriteLine("{0}.", EasyCommContext.Router.IsOnline ? "online" : "offline");
            //Trace.Write("Finding discovery url...");
            //Uri discoveryUrl = EasyCommContext.Router.ProxyUrl;
            //Trace.WriteLine(discoveryUrl.ToString());
            //Uri.TryCreate(, UriKind.RelativeOrAbsolute, out discoveryUrl);

            ServiceConfiguration.OnlineCheckInterval = 30;
            Trace.WriteLine("Loading NLB services...");
            EasyCommContext.Admin.LoadWorkerServiceAssembly(@"D:\Work\My Projects\Codeplex\EasyComm\WorkerModule\EasyComm.WorkerService\bin\Debug\EasyComm.WorkerService.dll");

            //using (ServiceProxy<IServiceContract> service = EasyCommContext.CreateProxy<IServiceContract>())
            //{
            //    service.Proxy.DoWork("WorkLoad");
            //}

            Trace.WriteLine("Press Enter key to exit.");
            Console.Read();
        }
    }
}
